/*
COMP 630C project
Re-implementation of R+ tree

Group member:
Cheng Wing Hang, Nelson
Cheung Kwok Ho, Steven
Ngai Ming Wai, Ryan
Shiu Hoi Nam
Tsui Chi Man*/

/*
This simple extension of the java.awt.Frame class
contains all the elements necessary to act as the
main window of an application.
*/
using System;
//UPGRADE_TODO: The type 'symantec.itools.awt.ImagePanel' could not be found. If it was not included in the conversion, there may be compiler issues. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1262'"
using ImagePanel = symantec.itools.awt.ImagePanel;
//UPGRADE_TODO: The type 'symantec.itools.awt.shape.Rect' could not be found. If it was not included in the conversion, there may be compiler issues. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1262'"
using Rect = symantec.itools.awt.shape.Rect;
//UPGRADE_TODO: Class 'java.awt.Frame' was converted to 'System.Windows.Forms.Form' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtFrame'"
[Serializable]
public class Frame1:System.Windows.Forms.Form
{
	static private System.Int32 state4;
	private static void  mouseDown(System.Object event_sender, System.Windows.Forms.MouseEventArgs e)
	{
		state4 = ((int) e.Button | (int) System.Windows.Forms.Control.ModifierKeys);
	}
	internal static RPlus root;
	internal Rect[] rects = new Rect[256];
	internal int counter = 0;
	
	public Frame1()
	{
		// This code is automatically generated by Visual Cafe when you add
		// components to the visual environment. It instantiates and initializes
		// the components. To modify the code, only use code syntax that matches
		// what Visual Cafe can generate, or Visual Cafe may be unable to back
		// parse your Java file into its visual environment.
		
		//{{INIT_CONTROLS
		//UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'"
		/*
		setLayout(null);*/
		//UPGRADE_TODO: Method 'java.awt.Component.setVisible' was converted to 'System.Windows.Forms.Control.Visible' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentsetVisible_boolean'"
		//UPGRADE_TODO: 'System.Windows.Forms.Application.Run' must be called to start a main form. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1135'"
		Visible = false;
		//UPGRADE_TODO: Method 'java.awt.Component.setSize' was converted to 'System.Windows.Forms.Control.Size' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentsetSize_int_int'"
		Size = new System.Drawing.Size(SupportClass.GetInsets(this)[1] + SupportClass.GetInsets(this)[2] + 755, SupportClass.GetInsets(this)[0] + SupportClass.GetInsets(this)[3] + 589);
		//UPGRADE_TODO: Constructor 'java.awt.Color.Color' was converted to 'System.Drawing.Color.FromArgb' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtColorColor_int'"
		ForeColor = System.Drawing.Color.FromArgb(0);
		openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
		//UPGRADE_ISSUE: Method 'java.awt.FileDialog.setMode' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtFileDialogsetMode_int'"
		openFileDialog1.setMode(0);
		openFileDialog1.Title = "Open";
		//$$ openFileDialog1.move(40,277);
		button1 = new System.Windows.Forms.Button();
		SupportClass.CommandManager.SetCommand(button1, "button");
		button1.Text = "Insert";
		button1.SetBounds(SupportClass.GetInsets(this)[1] + 696, SupportClass.GetInsets(this)[0] + 408, 50, 26);
		//UPGRADE_TODO: Constructor 'java.awt.Color.Color' was converted to 'System.Drawing.Color.FromArgb' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtColorColor_int'"
		button1.BackColor = System.Drawing.Color.FromArgb(12632256);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(button1);
		button2 = new System.Windows.Forms.Button();
		SupportClass.CommandManager.SetCommand(button2, "button");
		button2.Text = "Delete";
		button2.SetBounds(SupportClass.GetInsets(this)[1] + 696, SupportClass.GetInsets(this)[0] + 444, 50, 25);
		//UPGRADE_TODO: Constructor 'java.awt.Color.Color' was converted to 'System.Drawing.Color.FromArgb' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtColorColor_int'"
		button2.BackColor = System.Drawing.Color.FromArgb(12632256);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(button2);
		button3 = new System.Windows.Forms.Button();
		SupportClass.CommandManager.SetCommand(button3, "button");
		button3.Text = "Search";
		button3.SetBounds(SupportClass.GetInsets(this)[1] + 696, SupportClass.GetInsets(this)[0] + 480, 49, 25);
		//UPGRADE_TODO: Constructor 'java.awt.Color.Color' was converted to 'System.Drawing.Color.FromArgb' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtColorColor_int'"
		button3.BackColor = System.Drawing.Color.FromArgb(12632256);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(button3);
		button4 = new System.Windows.Forms.Button();
		SupportClass.CommandManager.SetCommand(button4, "button");
		button4.Text = "Pack";
		button4.SetBounds(SupportClass.GetInsets(this)[1] + 696, SupportClass.GetInsets(this)[0] + 516, 49, 26);
		//UPGRADE_TODO: Constructor 'java.awt.Color.Color' was converted to 'System.Drawing.Color.FromArgb' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtColorColor_int'"
		button4.BackColor = System.Drawing.Color.FromArgb(12632256);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(button4);
		button5 = new System.Windows.Forms.Button();
		SupportClass.CommandManager.SetCommand(button5, "button");
		button5.Text = "Exit";
		button5.SetBounds(SupportClass.GetInsets(this)[1] + 696, SupportClass.GetInsets(this)[0] + 552, 49, 26);
		//UPGRADE_TODO: Constructor 'java.awt.Color.Color' was converted to 'System.Drawing.Color.FromArgb' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtColorColor_int'"
		button5.BackColor = System.Drawing.Color.FromArgb(12632256);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(button5);
		textField1 = new System.Windows.Forms.TextBox();
		textField1.SetBounds(SupportClass.GetInsets(this)[1] + 612, SupportClass.GetInsets(this)[0] + 408, 74, 26);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(textField1);
		textField2 = new System.Windows.Forms.TextBox();
		textField2.SetBounds(SupportClass.GetInsets(this)[1] + 612, SupportClass.GetInsets(this)[0] + 444, 73, 25);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(textField2);
		textField3 = new System.Windows.Forms.TextBox();
		textField3.SetBounds(SupportClass.GetInsets(this)[1] + 612, SupportClass.GetInsets(this)[0] + 480, 74, 25);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(textField3);
		textField4 = new System.Windows.Forms.TextBox();
		textField4.SetBounds(SupportClass.GetInsets(this)[1] + 612, SupportClass.GetInsets(this)[0] + 516, 73, 25);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(textField4);
		textField5 = new System.Windows.Forms.TextBox();
		textField5.SetBounds(SupportClass.GetInsets(this)[1] + 612, SupportClass.GetInsets(this)[0] + 552, 72, 25);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(textField5);
		System.Windows.Forms.Label temp_Label;
		temp_Label = new System.Windows.Forms.Label();
		temp_Label.Text = "Low X";
		label1 = temp_Label;
		label1.SetBounds(SupportClass.GetInsets(this)[1] + 564, SupportClass.GetInsets(this)[0] + 408, 38, 25);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(label1);
		System.Windows.Forms.Label temp_Label2;
		temp_Label2 = new System.Windows.Forms.Label();
		temp_Label2.Text = "Low Y";
		label2 = temp_Label2;
		label2.SetBounds(SupportClass.GetInsets(this)[1] + 564, SupportClass.GetInsets(this)[0] + 444, 36, 23);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(label2);
		System.Windows.Forms.Label temp_Label3;
		temp_Label3 = new System.Windows.Forms.Label();
		temp_Label3.Text = "High X";
		label3 = temp_Label3;
		label3.SetBounds(SupportClass.GetInsets(this)[1] + 564, SupportClass.GetInsets(this)[0] + 480, 39, 25);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(label3);
		System.Windows.Forms.Label temp_Label4;
		temp_Label4 = new System.Windows.Forms.Label();
		temp_Label4.Text = "High Y";
		label4 = temp_Label4;
		label4.SetBounds(SupportClass.GetInsets(this)[1] + 564, SupportClass.GetInsets(this)[0] + 516, 37, 27);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(label4);
		System.Windows.Forms.Label temp_Label5;
		temp_Label5 = new System.Windows.Forms.Label();
		temp_Label5.Text = "OID";
		label5 = temp_Label5;
		label5.SetBounds(SupportClass.GetInsets(this)[1] + 564, SupportClass.GetInsets(this)[0] + 552, 38, 25);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(label5);
		System.Windows.Forms.TextBox temp_TextBox;
		//UPGRADE_TODO: The equivalent in .NET for field 'java.awt.TextArea.SCROLLBARS_VERTICAL_ONLY' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'";;
		temp_TextBox = new System.Windows.Forms.TextBox();
		temp_TextBox.Text = "";
		temp_TextBox.WordWrap = false;
		temp_TextBox.ScrollBars = (System.Windows.Forms.ScrollBars) System.Windows.Forms.ScrollBars.Vertical;
		temp_TextBox.Multiline = true;
		textArea1 = temp_TextBox;
		textArea1.ReadOnly = !false;
		textArea1.SetBounds(SupportClass.GetInsets(this)[1] + 552, SupportClass.GetInsets(this)[0] + 0, 204, 398);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(textArea1);
		//UPGRADE_ISSUE: Class hierarchy differences between 'java.awt.Panel' and 'System.Windows.Forms.Panel' may cause compilation errors. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1186'"
		panel1 = new System.Windows.Forms.Panel();
		//UPGRADE_ISSUE: Method 'java.awt.Container.setLayout' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtContainersetLayout_javaawtLayoutManager'"
		/*
		panel1.setLayout(null);*/
		panel1.SetBounds(SupportClass.GetInsets(this)[1] + 0, SupportClass.GetInsets(this)[0] + 0, 553, 589);
		//UPGRADE_TODO: Method 'java.awt.Container.add' was converted to 'System.Windows.Forms.ContainerControl.Controls.Add' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtContaineradd_javaawtComponent'"
		Controls.Add(panel1);
		Text = "A Basic Application";
		//}}
		
		//{{INIT_MENUS
		mainMenuBar = new System.Windows.Forms.MainMenu();
		menu1 = new System.Windows.Forms.MenuItem("File");
		miNew = new System.Windows.Forms.MenuItem("New");
		menu1.MenuItems.Add(miNew);
		miOpen = new System.Windows.Forms.MenuItem("Open...");
		menu1.MenuItems.Add(miOpen);
		miSave = new System.Windows.Forms.MenuItem("Save");
		menu1.MenuItems.Add(miSave);
		miSaveAs = new System.Windows.Forms.MenuItem("Save As...");
		menu1.MenuItems.Add(miSaveAs);
		menu1.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
		miExit = new System.Windows.Forms.MenuItem("Exit");
		menu1.MenuItems.Add(miExit);
		//mainMenuBar.add(menu1);
		menu2 = new System.Windows.Forms.MenuItem("Edit");
		miCut = new System.Windows.Forms.MenuItem("Cut");
		menu2.MenuItems.Add(miCut);
		miCopy = new System.Windows.Forms.MenuItem("Copy");
		menu2.MenuItems.Add(miCopy);
		miPaste = new System.Windows.Forms.MenuItem("Paste");
		menu2.MenuItems.Add(miPaste);
		//mainMenuBar.add(menu2);
		menu3 = new System.Windows.Forms.MenuItem("Help");
		//UPGRADE_ISSUE: Method 'java.awt.MenuBar.setHelpMenu' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtMenuBarsetHelpMenu_javaawtMenu'"
		mainMenuBar.setHelpMenu(menu3);
		miAbout = new System.Windows.Forms.MenuItem("About..");
		menu3.MenuItems.Add(miAbout);
		//mainMenuBar.add(menu3);
		Menu = mainMenuBar;
		//$$ mainMenuBar.move(4,277);
		//}}
		
		//{{REGISTER_LISTENERS
		SymWindow aSymWindow = new SymWindow(this);
		//UPGRADE_NOTE: Some methods of the 'java.awt.event.WindowListener' class are not used in the .NET Framework. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1308'"
		this.Closing += new System.ComponentModel.CancelEventHandler(aSymWindow.windowClosing);
		SymAction lSymAction = new SymAction(this);
		miOpen.Click += new System.EventHandler(lSymAction.actionPerformed);
		SupportClass.CommandManager.CheckCommand(miOpen);
		miAbout.Click += new System.EventHandler(lSymAction.actionPerformed);
		SupportClass.CommandManager.CheckCommand(miAbout);
		miExit.Click += new System.EventHandler(lSymAction.actionPerformed);
		SupportClass.CommandManager.CheckCommand(miExit);
		SymMouse aSymMouse = new SymMouse(this);
		button4.MouseDown += new System.Windows.Forms.MouseEventHandler(Frame1.mouseDown);
		button4.MouseDown += new System.Windows.Forms.MouseEventHandler(aSymMouse.mousePressed);
		button5.MouseDown += new System.Windows.Forms.MouseEventHandler(Frame1.mouseDown);
		button5.MouseDown += new System.Windows.Forms.MouseEventHandler(aSymMouse.mousePressed);
		button1.MouseDown += new System.Windows.Forms.MouseEventHandler(Frame1.mouseDown);
		button1.MouseDown += new System.Windows.Forms.MouseEventHandler(aSymMouse.mousePressed);
		button2.MouseDown += new System.Windows.Forms.MouseEventHandler(Frame1.mouseDown);
		button2.MouseDown += new System.Windows.Forms.MouseEventHandler(aSymMouse.mousePressed);
		button3.MouseDown += new System.Windows.Forms.MouseEventHandler(Frame1.mouseDown);
		button3.MouseDown += new System.Windows.Forms.MouseEventHandler(aSymMouse.mousePressed);
		//}}
	}
	
	public Frame1(System.String title):this()
	{
		Text = title;
	}
	
	//UPGRADE_NOTE: Since the declaration of the following entity is not virtual in .NET the modifier new was added. References to it may have been changed to InvokeMethodAsVirtual, GetPropertyAsVirtual or SetPropertyAsVirtual. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1195'"
	new virtual public void  Show()
	{
		//UPGRADE_TODO: Method 'java.awt.Component.move' was converted to 'System.Windows.Forms.Control.Location' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentmove_int_int'"
		Location = new System.Drawing.Point(50, 50);
		//UPGRADE_TODO: 'System.Windows.Forms.Application.Run' must be called to start a main form. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1135'"
		base.Show();
	}
	
	[STAThread]
	static public void  Main(System.String[] args)
	{
		int fillfactor = 3;
		
		root = new RPlus(fillfactor);
		
		//UPGRADE_TODO: 'System.Windows.Forms.Application.Run' must be called to start a main form. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1135'"
		(new Frame1()).Show();
	}
	
	//UPGRADE_NOTE: The equivalent of method 'java.awt.Frame.addNotify' is not an override method. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1143'"
	public void  addNotify()
	{
		// Record the size of the window prior to calling parents addNotify.
		System.Drawing.Size d = Size;
		
		//UPGRADE_ISSUE: Method 'java.awt.Frame.addNotify' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaawtFrameaddNotify'"
		base.addNotify();
		
		if (fComponentsAdjusted)
			return ;
		
		// Adjust components according to the insets
		//UPGRADE_TODO: Method 'java.awt.Component.setSize' was converted to 'System.Windows.Forms.Control.Size' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentsetSize_int_int'"
		Size = new System.Drawing.Size(SupportClass.GetInsets(this)[1] + SupportClass.GetInsets(this)[2] + d.Width, SupportClass.GetInsets(this)[0] + SupportClass.GetInsets(this)[3] + d.Height);
		System.Windows.Forms.Control[] temp_array;
		Frame1 temp_container;
		temp_container = this;
		temp_array = new System.Windows.Forms.Control[temp_container.Controls.Count];
		temp_container.Controls.CopyTo(temp_array, 0);
		System.Windows.Forms.Control[] components = temp_array;
		for (int i = 0; i < components.Length; i++)
		{
			System.Drawing.Point p = components[i].Location;
			p.Offset(SupportClass.GetInsets(this)[1], SupportClass.GetInsets(this)[0]);
			//UPGRADE_TODO: Method 'java.awt.Component.setLocation' was converted to 'System.Windows.Forms.Control.Location' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentsetLocation_javaawtPoint'"
			components[i].Location = p;
		}
		fComponentsAdjusted = true;
	}
	
	// Used for addNotify check.
	internal bool fComponentsAdjusted = false;
	
	//{{DECLARE_CONTROLS
	internal System.Windows.Forms.FileDialog openFileDialog1;
	internal System.Windows.Forms.Button button1;
	internal System.Windows.Forms.Button button2;
	internal System.Windows.Forms.Button button3;
	internal System.Windows.Forms.Button button4;
	internal System.Windows.Forms.Button button5;
	internal System.Windows.Forms.TextBox textField1;
	internal System.Windows.Forms.TextBox textField2;
	internal System.Windows.Forms.TextBox textField3;
	internal System.Windows.Forms.TextBox textField4;
	internal System.Windows.Forms.TextBox textField5;
	internal System.Windows.Forms.Label label1;
	internal System.Windows.Forms.Label label2;
	internal System.Windows.Forms.Label label3;
	internal System.Windows.Forms.Label label4;
	internal System.Windows.Forms.Label label5;
	internal System.Windows.Forms.TextBox textArea1;
	//UPGRADE_ISSUE: Class hierarchy differences between 'java.awt.Panel' and 'System.Windows.Forms.Panel' may cause compilation errors. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1186'"
	internal System.Windows.Forms.Panel panel1;
	//}}
	
	//{{DECLARE_MENUS
	internal System.Windows.Forms.MainMenu mainMenuBar;
	internal System.Windows.Forms.MenuItem menu1;
	internal System.Windows.Forms.MenuItem miNew;
	internal System.Windows.Forms.MenuItem miOpen;
	internal System.Windows.Forms.MenuItem miSave;
	internal System.Windows.Forms.MenuItem miSaveAs;
	internal System.Windows.Forms.MenuItem miExit;
	internal System.Windows.Forms.MenuItem menu2;
	internal System.Windows.Forms.MenuItem miCut;
	internal System.Windows.Forms.MenuItem miCopy;
	internal System.Windows.Forms.MenuItem miPaste;
	internal System.Windows.Forms.MenuItem menu3;
	internal System.Windows.Forms.MenuItem miAbout;
	//}}
	
	//UPGRADE_NOTE: Field 'EnclosingInstance' was added to class 'SymWindow' to access its enclosing instance. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1019'"
	internal class SymWindow
	{
		public SymWindow(Frame1 enclosingInstance)
		{
			InitBlock(enclosingInstance);
		}
		private void  InitBlock(Frame1 enclosingInstance)
		{
			this.enclosingInstance = enclosingInstance;
		}
		private Frame1 enclosingInstance;
		public Frame1 Enclosing_Instance
		{
			get
			{
				return enclosingInstance;
			}
			
		}
		public void  windowClosing(System.Object event_sender, System.ComponentModel.CancelEventArgs event_Renamed)
		{
			event_Renamed.Cancel = true;
			System.Object object_Renamed = event_sender;
			if (object_Renamed == Enclosing_Instance)
				Enclosing_Instance.Frame1_WindowClosing(event_sender, event_Renamed);
		}
	}
	
	internal virtual void  Frame1_WindowClosing(System.Object event_sender, System.ComponentModel.CancelEventArgs event_Renamed)
	{
		Hide(); // hide the Frame
		Dispose(); // free the system resources
		System.Environment.Exit(0); // close the application
	}
	
	//UPGRADE_NOTE: Field 'EnclosingInstance' was added to class 'SymAction' to access its enclosing instance. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1019'"
	internal class SymAction
	{
		public SymAction(Frame1 enclosingInstance)
		{
			InitBlock(enclosingInstance);
		}
		private void  InitBlock(Frame1 enclosingInstance)
		{
			this.enclosingInstance = enclosingInstance;
		}
		private Frame1 enclosingInstance;
		public Frame1 Enclosing_Instance
		{
			get
			{
				return enclosingInstance;
			}
			
		}
		public virtual void  actionPerformed(System.Object event_sender, System.EventArgs event_Renamed)
		{
			System.Object object_Renamed = event_sender;
			if (object_Renamed == Enclosing_Instance.miOpen)
				Enclosing_Instance.miOpen_Action(event_sender, event_Renamed);
			else if (object_Renamed == Enclosing_Instance.miAbout)
				Enclosing_Instance.miAbout_Action(event_sender, event_Renamed);
			else if (object_Renamed == Enclosing_Instance.miExit)
				Enclosing_Instance.miExit_Action(event_sender, event_Renamed);
		}
	}
	
	internal virtual void  miAbout_Action(System.Object event_sender, System.EventArgs event_Renamed)
	{
		//{{CONNECTION
		// Action from About Create and show as modal
		//UPGRADE_TODO: Method 'java.awt.Dialog.show' was converted to 'System.Windows.Forms.Form.ShowDialog' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtDialogshow'"
		(new AboutDialog(this, true)).ShowDialog();
		//}}
	}
	
	internal virtual void  miExit_Action(System.Object event_sender, System.EventArgs event_Renamed)
	{
		//{{CONNECTION
		// Action from Exit Create and show as modal
		//UPGRADE_TODO: Method 'java.awt.Dialog.show' was converted to 'System.Windows.Forms.Form.ShowDialog' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtDialogshow'"
		(new QuitDialog(this, true)).ShowDialog();
		//}}
	}
	
	internal virtual void  miOpen_Action(System.Object event_sender, System.EventArgs event_Renamed)
	{
		//{{CONNECTION
		// Action from Open... Show the OpenFileDialog
		openFileDialog1.ShowDialog();
		//}}
	}
	
	//UPGRADE_NOTE: Field 'EnclosingInstance' was added to class 'SymMouse' to access its enclosing instance. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1019'"
	internal class SymMouse
	{
		public SymMouse(Frame1 enclosingInstance)
		{
			InitBlock(enclosingInstance);
		}
		private void  InitBlock(Frame1 enclosingInstance)
		{
			this.enclosingInstance = enclosingInstance;
		}
		private Frame1 enclosingInstance;
		public Frame1 Enclosing_Instance
		{
			get
			{
				return enclosingInstance;
			}
			
		}
		public void  mousePressed(System.Object event_sender, System.Windows.Forms.MouseEventArgs event_Renamed)
		{
			System.Object object_Renamed = event_sender;
			if (object_Renamed == Enclosing_Instance.button5)
				Enclosing_Instance.button5_MousePress(event_sender, event_Renamed);
			else if (object_Renamed == Enclosing_Instance.button1)
				Enclosing_Instance.button1_MousePress(event_sender, event_Renamed);
			else if (object_Renamed == Enclosing_Instance.button2)
				Enclosing_Instance.button2_MousePress(event_sender, event_Renamed);
			else if (object_Renamed == Enclosing_Instance.button3)
				Enclosing_Instance.button3_MousePress(event_sender, event_Renamed);
			else if (object_Renamed == Enclosing_Instance.button4)
				Enclosing_Instance.button4_MousePress(event_sender, event_Renamed);
		}
	}
	
	internal virtual void  button5_MousePress(System.Object event_sender, System.Windows.Forms.MouseEventArgs event_Renamed)
	{
		// to do: code goes here.
		System.Environment.Exit(0);
	}
	
	internal virtual void  button1_MousePress(System.Object event_sender, System.Windows.Forms.MouseEventArgs event_Renamed)
	{
		// to do: code goes here.
		RECT rec;
		MBR obj;
		System.String text1, text2, text3, text4, text5;
		System.Single t1, t2, t3, t4;
		System.Int32 t5;
		
		text1 = textField1.Text;
		text2 = textField2.Text;
		text3 = textField3.Text;
		text4 = textField4.Text;
		text5 = textField5.Text;
		
		if (text1.Length == 0 || text2.Length == 0 || text3.Length == 0 || text4.Length == 0 || text5.Length == 0)
		{
			textArea1.ReadOnly = !true;
			textArea1.AppendText("Incorrect input\n");
			textArea1.ReadOnly = !false;
		}
		else
		{
			t1 = System.Single.Parse(text1);
			t2 = System.Single.Parse(text2);
			t3 = System.Single.Parse(text3);
			t4 = System.Single.Parse(text4);
			t5 = System.Int32.Parse(text5);
			//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Float.floatValue' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
			rec = new RECT((float) t1, (float) t2, (float) t3, (float) t4);
			obj = new MBR(rec, t5);
			
			root.insert(obj);
		}
		textField1.Text = "";
		textField2.Text = "";
		textField3.Text = "";
		textField4.Text = "";
		textField5.Text = "";
		this.redraw();
	}
	
	internal virtual void  button2_MousePress(System.Object event_sender, System.Windows.Forms.MouseEventArgs event_Renamed)
	{
		// to do: code goes here.
		RECT rec;
		MBR obj;
		System.String text1, text2, text3, text4, text5;
		System.Single t1, t2, t3, t4;
		System.Int32 t5;
		
		text1 = textField1.Text;
		text2 = textField2.Text;
		text3 = textField3.Text;
		text4 = textField4.Text;
		text5 = textField5.Text;
		
		if (text1.Length != 0 || text2.Length != 0 || text3.Length != 0 || text4.Length != 0 || text5.Length == 0)
		{
			textArea1.ReadOnly = !true;
			textArea1.AppendText("Incorrect input\n");
			textArea1.ReadOnly = !false;
		}
		else
		{
			t5 = System.Int32.Parse(text5);
			
			root.delete(t5);
		}
		textField1.Text = "";
		textField2.Text = "";
		textField3.Text = "";
		textField4.Text = "";
		textField5.Text = "";
		this.redraw();
	}
	
	internal virtual void  button3_MousePress(System.Object event_sender, System.Windows.Forms.MouseEventArgs event_Renamed)
	{
		// to do: code goes here.
		RECT rec;
		MBR obj;
		node result;
		CELL ptr;
		System.String text1, text2, text3, text4, text5;
		System.Single t1, t2, t3, t4;
		System.Int32 t5;
		
		result = new node();
		text1 = textField1.Text;
		text2 = textField2.Text;
		text3 = textField3.Text;
		text4 = textField4.Text;
		text5 = textField5.Text;
		
		textField1.Text = "";
		textField2.Text = "";
		textField3.Text = "";
		textField4.Text = "";
		textField5.Text = "";
		
		if (text1.Length == 0 || text2.Length == 0 || text3.Length == 0 || text4.Length == 0 || text5.Length != 0)
		{
			textArea1.ReadOnly = !true;
			textArea1.AppendText("Incorrect input\n");
			textArea1.ReadOnly = !false;
			return ;
		}
		else
		{
			t1 = System.Single.Parse(text1);
			t2 = System.Single.Parse(text2);
			t3 = System.Single.Parse(text3);
			t4 = System.Single.Parse(text4);
			//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Float.floatValue' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
			rec = new RECT((float) t1, (float) t2, (float) t3, (float) t4);
			
			result = root.search(rec);
		}
		
		textArea1.AppendText("Search result :\n");
		ptr = new CELL();
		ptr = result.head;
		while (ptr != null)
		{
			textArea1.AppendText("Object " + ptr.current.oid + "\n");
			ptr = ptr.next;
		}
	}
	
	internal virtual void  button4_MousePress(System.Object event_sender, System.Windows.Forms.MouseEventArgs event_Renamed)
	{
		// to do: code goes here.
		root.pack();
		this.redraw();
	}
	
	internal virtual void  draw_child(RECT mbr, int color)
	{
		System.Single x, y, lenx, leny;
		
		x = (float) (mbr.low[0] * 4);
		lenx = (float) ((mbr.high[0] - mbr.low[0]) * 4);
		leny = (float) ((mbr.high[1] - mbr.low[1]) * 4);
		//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Float.floatValue' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
		y = (float) (589 - (mbr.low[1] * 4 + (float) leny));
		rects[counter] = new symantec.itools.awt.shape.Rect();
		rects[counter].setBounds((int) x, (int) y, (int) lenx, (int) leny);
		//UPGRADE_TODO: Constructor 'java.awt.Color.Color' was converted to 'System.Drawing.Color.FromArgb' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtColorColor_int'"
		rects[counter].setForeground(System.Drawing.Color.FromArgb(color * 35000));
		panel1.add(rects[counter]);
		counter++;
	}
	
	internal virtual void  draw_node(RECT mbr, int color)
	{
		System.Single x, y, lenx, leny;
		
		x = (float) (mbr.low[0] * 4);
		lenx = (float) ((mbr.high[0] - mbr.low[0]) * 4);
		leny = (float) ((mbr.high[1] - mbr.low[1]) * 4);
		//UPGRADE_TODO: The equivalent in .NET for method 'java.lang.Float.floatValue' may return a different value. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1043'"
		y = (float) (589 - (mbr.low[1] * 4 + (float) leny));
		rects[counter] = new symantec.itools.awt.shape.Rect();
		rects[counter].setBounds((int) x - 2, (int) y - 2, (int) lenx + 4, (int) leny + 4);
		//UPGRADE_TODO: Constructor 'java.awt.Color.Color' was converted to 'System.Drawing.Color.FromArgb' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtColorColor_int'"
		rects[counter].setForeground(System.Drawing.Color.FromArgb(color * 35000));
		panel1.add(rects[counter]);
		counter++;
	}
	
	internal virtual void  recur_draw(CELL ptr, int color)
	{
		while (ptr != null)
		{
			if (ptr.current.oid == 0)
			{
				recur_draw(ptr.child.head, color + 1);
				draw_node(ptr.current.mbr, color);
			}
			else
			{
				draw_child(ptr.current.mbr, color);
			}
			ptr = ptr.next;
		}
	}
	
	internal virtual void  redraw()
	{
		System.Single x, y, lenx, leny;
		int i;
		
		for (i = 0; i < counter; i++)
		{
			panel1.remove(rects[i]);
		}
		
		counter = 0;
		recur_draw(root.head.head, 0);
		//UPGRADE_TODO: Method 'java.awt.Component.repaint' was converted to 'System.Windows.Forms.Control.Refresh' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaawtComponentrepaint'"
		panel1.Refresh();
	}
}